package TreeHole.event;

import TreeHole.mod.TreeHoleHelper;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.events.AbstractImageEvent;
import com.megacrit.cardcrawl.localization.EventStrings;
import com.megacrit.cardcrawl.random.Random;

import java.util.ArrayList;


public class TreeHoleEvent extends AbstractImageEvent {

    public static final String ID = "treehole:TreeHole";
    private static final EventStrings eventStrings;
    public static final String NAME;
    public static final String[] DESCRIPTIONS;
    public static final String[] OPTIONS;

    ArrayList<String> ids;

    Random rng;

    public TreeHoleEvent(Random rng){
        super(NAME,DESCRIPTIONS[0],"TreeHoleResources/img/events/TreeHole.png");
        ids = TreeHoleHelper.getSharedIDs();
        ArrayList<String> options = TreeHoleHelper.getEnterOptions();
        for(String option:options)
            imageEventText.setDialogOption(option);
        this.rng = rng;
    }

    @Override
    protected void buttonEffect(int i) {
        AbstractDungeon.getCurrRoom().event = TreeHoleHelper.treeHoleEnterEvent(ids.get(i),rng);
        AbstractDungeon.getCurrRoom().event.onEnterRoom();
    }


    static {
        eventStrings = CardCrawlGame.languagePack.getEventString(ID);
        NAME = eventStrings.NAME;
        DESCRIPTIONS = eventStrings.DESCRIPTIONS;
        OPTIONS = eventStrings.OPTIONS;
    }
}
